feat: make async row-group horizon configurable#745
Conversation
Review: PR #745 — Expose row-group admission controlsSummaryThis PR promotes the previously-internal row-group admission controls of The core API is small, well validated, and correctly preserves defaults: FindingsBehavior change worth a release-note callout (medium)
In practice this is unlikely to bite typical users (
|
Greptile SummaryThis PR exposes
|
| Filename | Overview |
|---|---|
| packages/data-designer-config/src/data_designer/config/run_config.py | Adds max_concurrent_row_groups field with correct default (3), ge=1 constraint, and docstring; placement between buffer_size and max_in_flight_tasks is consistent with the logical grouping. |
| packages/data-designer-engine/src/data_designer/engine/dataset_builders/dataset_builder.py | Single-line addition forwarding run_config.max_concurrent_row_groups to the AsyncTaskScheduler constructor; correctly placed alongside the other scheduler kwargs. |
| packages/data-designer-config/tests/config/test_run_config.py | Three focused tests covering default, custom, and invalid values of max_concurrent_row_groups; pattern matches existing test style. |
| packages/data-designer-engine/tests/engine/dataset_builders/test_async_builder_integration.py | Both SimpleNamespace run_config stubs updated with max_concurrent_row_groups; test_prepare_async_run_enables_request_pressure_advisory asserts the forwarded value is correct. |
| architecture/dataset-builders.md | Clarifies that the hard cap is now surfaced as RunConfig.max_concurrent_row_groups and notes the adaptive mode remains internal; accurate. |
| fern/versions/latest/pages/concepts/architecture-and-performance.mdx | Adds a new section for max_concurrent_row_groups with a usage example and trade-off notes; concurrency formula updated to reflect multi-row-group semantics. |
Sequence Diagram
%%{init: {'theme': 'neutral'}}%%
sequenceDiagram
participant User
participant RunConfig
participant DatasetBuilder
participant AsyncTaskScheduler
User->>RunConfig: "RunConfig(max_concurrent_row_groups=N)"
Note over RunConfig: Validates N >= 1
User->>DatasetBuilder: builder.build(num_records, ...)
DatasetBuilder->>DatasetBuilder: _prepare_async_run(...)
DatasetBuilder->>AsyncTaskScheduler: "AsyncTaskScheduler(..., max_concurrent_row_groups=N, ...)"
Note over AsyncTaskScheduler: _rg_semaphore = Semaphore(N)<br/>_row_group_admission_hard_cap = max(1, N)<br/>_row_group_admission_target = N (fixed mode)
AsyncTaskScheduler-->>DatasetBuilder: scheduler
DatasetBuilder-->>User: dataset
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
sequenceDiagram
participant User
participant RunConfig
participant DatasetBuilder
participant AsyncTaskScheduler
User->>RunConfig: "RunConfig(max_concurrent_row_groups=N)"
Note over RunConfig: Validates N >= 1
User->>DatasetBuilder: builder.build(num_records, ...)
DatasetBuilder->>DatasetBuilder: _prepare_async_run(...)
DatasetBuilder->>AsyncTaskScheduler: "AsyncTaskScheduler(..., max_concurrent_row_groups=N, ...)"
Note over AsyncTaskScheduler: _rg_semaphore = Semaphore(N)<br/>_row_group_admission_hard_cap = max(1, N)<br/>_row_group_admission_target = N (fixed mode)
AsyncTaskScheduler-->>DatasetBuilder: scheduler
DatasetBuilder-->>User: dataset
Reviews (6): Last reviewed commit: "Merge branch 'main' into etramel/fix/741..." | Re-trigger Greptile
1872d25 to
abe044f
Compare
* refactor: remove verified dead code Remove unreachable helpers and production code exercised only by tests after a triple review of static references, runtime registration paths, and extension surfaces. Keep reusable observability fixtures in the explicit engine.testing namespace. Closes #789 Signed-off-by: Nabin Mulepati <nmulepati@nvidia.com> * fix: preserve active capacity diagnostics Restore the capacity-plan module, scheduler observation state, completion APIs, and their tests because open PRs #745 and #743 actively extend or assert these artifacts. Signed-off-by: Nabin Mulepati <nmulepati@nvidia.com> --------- Signed-off-by: Nabin Mulepati <nmulepati@nvidia.com>
Expose a single validated RunConfig override for the fixed async row-group cap while preserving the default of three. Keep adaptive admission and completion machinery internal. Signed-off-by: Eric W. Tramel <eric.tramel@gmail.com>
abe044f to
e465a84
Compare
|
Nice work on this one, @eric-tramel — clean, well-contained change. SummaryExposes a single validated FindingsSuggestions — Take it or leave it
Existing bot comments (not this diff)
What Looks Good
VerdictShip it (with nits) — Only optional documentation-level suggestions. The code change is minimal, correct, well-tested, and preserves existing behavior.
This review was generated by an AI assistant. |
nabinchha
left a comment
There was a problem hiding this comment.
Ship it (with nits) — clean, well-scoped change. Default preserved end-to-end, tests cover the right seams, and ruff check/format pass locally. Only optional documentation-level suggestions (see review comment).
Signed-off-by: Eric W. Tramel <eric.tramel@gmail.com>
📋 Summary
Exposes a single advanced
RunConfig.max_concurrent_row_groupssetting for the async scheduler's fixed row-group horizon. The historical default remains3; adaptive admission, active-row budgets, and completion/checkpoint changes are intentionally out of scope.🔗 Related Issue
Refs #741
🔄 Changes
>= 1) toRunConfigand forwards it to the existing async scheduler setting.buffer_size, request concurrency, memory use, and checkpoint timing.mainand reconciles the concurrency documentation with the current request-admission terminology.🧪 Testing
.venv/bin/pytest packages/data-designer-config/tests/config/test_run_config.py(31 passed).venv/bin/pytest packages/data-designer-engine/tests/engine/dataset_builders/test_async_builder_integration.py(10 passed)make check-fern-docs(fern check: 0 errors, 1 warning)✅ Checklist
Description updated with AI